home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / guidesdelegate.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-01-21  |  1.9 KB  |  83 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. #ifndef GUIDESDELEGATE_H
  8. #define GUIDESDELEGATE_H
  9.  
  10. #include <QItemDelegate>
  11.  
  12. class ScribusDoc;
  13.  
  14.  
  15. /*! \brief A delegate/editor for guides model.
  16. It's based on the ScrSpinBox widget. User cannot enter
  17. any others (ugly and bad) values.
  18. \author Petr Vanek <petr@scribus.info>
  19. */
  20. class GuidesDelegate : public QItemDelegate
  21. {
  22.     Q_OBJECT
  23.  
  24.     public:
  25.         GuidesDelegate(QObject *parent = 0);
  26.  
  27. // implemented in inheritance
  28. //         QWidget *createEditor(QWidget *parent,
  29. //                             const QStyleOptionViewItem &option,
  30. //                             const QModelIndex &index) const;
  31.  
  32.         void setEditorData(QWidget *editor, const QModelIndex &index) const;
  33.  
  34.         void setModelData(QWidget *editor,
  35.                         QAbstractItemModel *model,
  36.                         const QModelIndex &index) const;
  37.  
  38.         void updateEditorGeometry(QWidget *editor,
  39.                                 const QStyleOptionViewItem &option,
  40.                                 const QModelIndex &index) const;
  41.  
  42.         void unitChange(int docUnitDecimals);
  43.         void setDoc(ScribusDoc * doc);
  44.  
  45.     // protected due const in createEditor
  46.     protected:
  47.         ScribusDoc *m_doc;
  48. };
  49.  
  50.  
  51. /*! \brief A delegate for horizontal guides model/view.
  52. Limit guides for page height
  53.  */
  54. class GuidesHDelegate : public GuidesDelegate
  55. {
  56.     Q_OBJECT
  57.  
  58.     public:
  59.         GuidesHDelegate(QObject *parent = 0);
  60.  
  61.         QWidget *createEditor(QWidget *parent,
  62.                               const QStyleOptionViewItem &option,
  63.                               const QModelIndex &index) const;
  64. };
  65.  
  66.  
  67. /*! \brief A delegate for vertical guides model/view.
  68. Limit guides for page width
  69.  */
  70. class GuidesVDelegate : public GuidesDelegate
  71. {
  72.     Q_OBJECT
  73.  
  74.     public:
  75.         GuidesVDelegate(QObject *parent = 0);
  76.  
  77.         QWidget *createEditor(QWidget *parent,
  78.                               const QStyleOptionViewItem &option,
  79.                               const QModelIndex &index) const;
  80. };
  81.  
  82. #endif
  83.